{template 'yellowpage_header.html','yellowpage'}

<div class="container">
	<div class="aside">
    	
        {if $m_user}
        <div class="mod">
            <div class="head">热点导航</div>
            <div class="body">
                <ul>
                {loop $m_user $ms}
                  <li><a href="{$ms[url]}">{$ms[catname]}</a></li>
                {/loop}
                </ul>
            </div>
        </div>
        {/if}
        
        <div class="mod">
            <div class="head">最新消息</div>
            <div class="body">
                <ul>
                {get sql="SELECT * FROM `table_yellowpage_news` WHERE `userid`='$userid' AND status=99 ORDER BY id DESC" rows="10"}
                <li><a href="{url($r[url])}" title="{$r[title]}">{str_cut($r[title],28,'')}</a></li>
                {/get}
                      </ul>
            </div>
        </div>
        
        <div class="mod">
            <div class="head">站内搜索</div>
            <div class="body">
                <form class="box" action="{$M['url']}web/query.php">
                  <input type="text" name="q" size="16"/><input name="search" type="submit" id="search" value="搜索"/><br/>
                  <input type="radio" name="type" checked="checked" value="product"/>商品<input type="radio" name="type" value="buy"/>商机<input value="news" type="radio" name="type"/>新闻<input type="hidden" value="search" name="action" /><input name="userid" value="{$userid}" type="hidden" />
                </form>
            </div>
        </div>
            
    </div>
    <div class="main">
    	 
        <div class="mod">
            <div class="head">{$system_name[$category]}</div>
            <div class="body">
                 
                 <form action="" method="post" name="myform" id="myform" onsubmit='return CheckForm();'>
                <table width="759" border="0" class="">
                  <tr>
                    <td width="82">您的姓名：</td>
                    <td width="667"><input name="new_username" id="new_username" type="text" size="20" maxlength="10" value="{$_nickname}" {if $_nickname}readonly{/if}/> *</td>
                  </tr>
                  <tr>
                    <td>公司传真：</td>
                    <td><input name="new_fax" id="new_fax" type="text" size="20"></td>
                  </tr>
                  <tr>
                    <td>联系电话：</td>
                    <td><input name="new_telephone" id="new_telephone" type="text" size="20" maxlength="50" value=""/> *</td>
                  </tr>
                  <tr>
                    <td>Email：</td>
                    <td><input name="new_email" id="new_email" type="text" size="20" value="{$_email}"/></td>
                  </tr>
                  <tr>
                    <td>所在单位：</td>
                    <td><input name="new_unit" id="new_unit" type="text" size="20"> * </td>
                  </tr>
                  <tr>
                    <td>QQ：</td>
                    <td><input name="new_qq" id="new_qq" type="text" size="20" maxlength="9" value=""/></td>
                  </tr>
                  <tr>
                    <td>MSN：</td>
                    <td><input name="new_msn" id="new_msn" type="text" size="20" value=""></td>
                  </tr>
                  <tr>
                    <td>留言内容：</td>
                    <td><textarea name="new_content" id="new_content" rows="6" cols="54"></textarea></td>
                  </tr>
                  <tr>
                    <td>验证码：</td>
                    <td><input name="checkcodestr" type="text" size="4" id="code" require="true" datatype="require"  msgid="ccode" msg="验证码必须填写">
                <img src="misc/checkcode/checkcode.php" id="checkcode" onclick="this.src='misc/checkcode/checkcode.php?id='+Math.random()*5;" style="cursor:pointer;" alt="验证码,看不清楚?请点击刷新验证码" align="absmiddle"/></td>
                  </tr>
                  <tr>
                    <td>
                    	<input name="dosubmit" type="submit" value=" 提交留言 " />
                        <input name="userid" type="hidden" value="{$userid}" />
                        <input name="action" type="hidden" value="guestbook" />
                        <input name="label" type="hidden" value="{$label}" />
                        <input name="forwardpage" type="hidden" value="{$forward}" />
                        <input name="id" type="hidden" value="{$id}" />
                    </td>
                    <td>&nbsp;</td>
                  </tr>
                </table>
                </form>
              </div>
          </div>
          
     </div>
 </div>  


<script type="text/javascript">
var CheckForm = function()
{
	var us = $(":input[name='new_username']");
	var ph = $(":input[name='new_telephone']");
	var un = $(":input[name='new_unit']");
	var cnt = $("textarea#new_content");
	var ch = $(":input[name='checkcodestr']");
	if(us.val().length <3 || us.val().length > 20)
	{
		alert('请输入正确的用户名');
		us.select();
		return false;
	}
	else if(!ph.val().match(/^((\(\d{2,3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/i))
	{
		alert('请输入正确的电话号码');
		ph.select();
		return false;
	}
	else if(un.val().length < 1)
	{
		alert('请输入单位名称');
		un.select();
		return false;
	}
	else if(cnt.val().length < 1)
	{
		alert('请输入留言内容');
		cnt.select();
		return false;
	}
	else if(ch.val().length != 4)
	{
		alert('请输入验证码');
		ch.select();
		return false;
	}
	else return true;
}
</script>

{template 'yellowpage_footer.html','yellowpage'} 